package com.cdc.sboot.control;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hello5")
public class HelloController5 {
	//将注解与变量联系起来
	@Value("${cupSize}")
	private String cupSize;
	
	@Value("${age}")
	private Integer age;
	
	@Value("${content}")
	private String content;
	@Autowired
	private PersonProperties person;
	
	@RequestMapping(value="/say",method=RequestMethod.GET)
	public String say() {
		return "hello spring boot say "+content+"==="+person.toString();
	}
	
	@RequestMapping(value="/read",method=RequestMethod.GET)
	public String read() {
		return "hello spring boot read "+content+"==="+person.toString();
	}

}
